<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/login', 'System\LoginController@index');
Route::post('/login', 'System\LoginController@login');
Route::post('/logout', 'System\LoginController@logout');

Route::group(['middleware'=>'check.login'],function(){
    Route::get('/', 'IndexController@index');
    Route::get('/main', 'IndexController@index');

    Route::get('/sys/menu', 'System\menuController@index');
    Route::post('/sys/menu/list', 'System\menuController@listData');
    Route::post('/sys/menu/listTree', 'System\menuController@treeData');
    Route::get('/sys/menu/add', 'System\menuController@showAddForm');
    Route::get('/sys/menu/edit', 'System\menuController@showEditForm');
    Route::post('/sys/menu/save', 'System\menuController@save');
    Route::post('/sys/menu/getMenuBtnlist', 'System\menuController@getMenuBtnlist');
    Route::get('/sys/menu/setBtn', 'System\menuController@setBtn');
    Route::post('/sys/menu/saveBtn', 'System\menuController@saveBtn');

    Route::get('/sys/menu/setMenuData', 'System\menuController@setMenuData');
    Route::post('/sys/menu/getMenuDatalist', 'System\menuController@getMenuDatalist');
    Route::get('/sys/menu/addMenuRule', 'System\menuController@addMenuRuleForm');
    Route::get('/sys/menu/editMenuRule', 'System\menuController@editMenuRuleForm');
    Route::post('/sys/menu/saveMenuRule', 'System\menuController@saveMenuRule');

    Route::get('/sys/dict', 'System\DictController@index');
    Route::post('/sys/dict/list', 'System\DictController@listData');
    Route::get('/sys/dict/add', 'System\DictController@showAddForm');
    Route::get('/sys/dict/edit', 'System\DictController@showEditForm');
    Route::post('/sys/dict/save', 'System\DictController@save');

    Route::get('/storage/warehouse', 'Storage\WarehouseController@index');
    Route::post('/storage/warehouse/list', 'Storage\WarehouseController@listData');

    Route::get('/storage/warehouse/warehouselist', 'Storage\WarehouseController@warehouseList');
    Route::get('/storage/warehouse/add', 'Storage\WarehouseController@showAddForm');
    Route::get('/storage/warehouse/edit', 'Storage\WarehouseController@showEditForm');
    Route::post('/storage/warehouse/save', 'Storage\WarehouseController@save');

    Route::get('/storage/storage', 'Storage\StorageController@index');
    Route::post('/storage/storage/list', 'Storage\StorageController@listData');

    Route::get('/storage/movement', 'Storage\MovementController@index');
    Route::post('/storage/movement/list', 'Storage\MovementController@listData');
    Route::post('/storage/storage/movement/goodslist', 'Storage\MovementController@listDataGoods');
    Route::get('/storage/movement/add', 'Storage\MovementController@showAddForm');
    Route::get('/storage/movement/edit', 'Storage\MovementController@showEditForm');
    Route::post('/storage/movement/movementadd', 'Storage\MovementController@movementAdd');

    Route::get('/sys/button', 'System\SysButtonController@index');
    Route::post('/sys/button/list', 'System\SysButtonController@listData');
    Route::get('/sys/button/add', 'System\SysButtonController@showAddForm');
    Route::get('/sys/button/edit', 'System\SysButtonController@showEditForm');
    Route::post('/sys/button/save', 'System\SysButtonController@save');

    Route::get('/sys/client', 'System\ClientController@index');
    Route::post('/sys/client/list', 'System\ClientController@listData');
    Route::get('/sys/client/add', 'System\ClientController@showAddForm');
    Route::get('/sys/client/edit', 'System\ClientController@showEditForm');
    Route::post('/sys/client/save', 'System\ClientController@save');
    Route::post('/sys/client/remove', 'System\ClientController@remove');

    Route::get('/sys/role', 'System\RoleController@index');
    Route::post('/sys/role/list', 'System\RoleController@listData');
    Route::get('/sys/role/add', 'System\RoleController@showAddForm');
    Route::get('/sys/role/edit', 'System\RoleController@showEditForm');
    Route::post('/sys/role/save', 'System\RoleController@save');
    Route::post('/sys/role/delAdd', 'System\RoleController@delAdd');
    Route::get('/sys/role/roleassign', 'System\RoleController@roleAssign');

    Route::get('/sys/un_inquiry', 'System\InquiryController@index');
    Route::post('/sys/un_inquiry/list', 'System\InquiryController@listData');
    Route::get('/sys/un_inquiry/edit', 'System\InquiryController@showEditForm');
    Route::post('/sys/un_inquiry/save', 'System\InquiryController@save');

    Route::get('/sys/en_inquiry', 'System\InquiryController@indexEninquiry');
    Route::post('/sys/en_inquiry/list', 'System\InquiryController@listDataEninquiry');

    Route::get('/sys/org', 'System\OrgController@index');
    Route::post('/sys/org/list', 'System\OrgController@getOrgList');
    Route::post('/sys/org/tree', 'System\OrgController@getOrgTree');
    Route::get('/sys/org/add', 'System\OrgController@showAddForm');
    Route::get('/sys/org/edit', 'System\OrgController@showEditForm');
    Route::post('/sys/org/save', 'System\OrgController@save');
    Route::post('/sys/org/remove', 'System\OrgController@remove');

    Route::get('/product/label', 'Product\LabelController@index');
    Route::post('/product/label/list', 'Product\LabelController@listData');
    Route::any('/product/label/tree', 'Product\LabelController@getList');
    Route::get('/product/label/add', 'Product\LabelController@showAddForm');
    Route::get('/product/label/edit', 'Product\LabelController@showEditForm');
    Route::post('/product/label/save', 'Product\LabelController@save');


    Route::get('/product/cate', 'Product\CateController@index');
    Route::post('/product/cate/list', 'Product\CateController@listData');
    Route::any('/product/cate/tree', 'Product\CateController@getCateTree');
    Route::get('/product/cate/add', 'Product\CateController@showAddForm');
    Route::get('/product/cate/edit', 'Product\CateController@showEditForm');
    Route::post('/product/cate/save', 'Product\CateController@save');

    Route::get('/product/brand', 'Product\BrandController@index');
    Route::post('/product/brand/list', 'Product\BrandController@listData');
    Route::any('/product/brand/tree', 'Product\BrandController@getList');
    Route::get('/product/brand/add', 'Product\BrandController@showAddForm');
    Route::get('/product/brand/edit', 'Product\BrandController@showEditForm');
    Route::post('/product/brand/save', 'Product\BrandController@save');

    Route::get('/sys/user', 'System\UserController@index');
    Route::post('/sys/user/list', 'System\UserController@getUserList');
    Route::get('/sys/user/add', 'System\UserController@showAddForm');
    Route::get('/sys/user/edit', 'System\UserController@showEditForm');
    Route::post('/sys/user/save', 'System\UserController@save');
    Route::post('/sys/user/remove', 'System\UserController@remove');
    Route::get('/sys/user/powerindex', 'System\UserController@powerIndex');
    Route::post('/sys/user/powerlist', 'System\UserController@getPowerList');
    Route::get('/sys/user/poweradd', 'System\UserController@showAddPower');
    Route::get('/sys/user/poweredit', 'System\UserController@showEditPower');
    Route::post('/sys/user/powersave', 'System\UserController@savePower');
    Route::post('/sys/user/powerremove', 'System\UserController@removePower');

    Route::get('/sys/period', 'System\PeriodController@index');
    Route::post('/sys/period/list', 'System\PeriodController@listData');
    Route::get('/sys/period/add', 'System\PeriodController@showAddForm');
    Route::get('/sys/period/edit', 'System\PeriodController@showEditForm');
    Route::post('/sys/period/save', 'System\PeriodController@save');
    Route::post('/sys/period/openorclose', 'System\PeriodController@openOrClose');

    Route::get('/product/goods', 'Product\GoodsController@index');
    Route::post('/product/goods/list', 'Product\GoodsController@listData');
    Route::get('/product/goods/add', 'Product\GoodsController@showAddForm');
    Route::get('/product/goods/edit', 'Product\GoodsController@showEditForm');
    Route::post('/product/goods/save', 'Product\GoodsController@save');
    Route::get('/product/goods/changeprice', 'Product\GoodsController@changePrice');
    Route::post('/product/goods/adjust', 'Product\GoodsController@adjust');

    Route::get('/product/goods/ajaxlist', 'Product\GoodsController@goodsAjax');

    Route::get('/sale/requisition', 'Order\RequisitionController@index');
    Route::post('/sale/requisition/list', 'Order\RequisitionController@listData');
    Route::post('/sale/requisition/goodslist', 'Order\RequisitionController@getGoodsList');
    Route::get('/sale/requisition/add', 'Order\RequisitionController@showAddForm');
    Route::post('/sale/requisition/savereq', 'Order\RequisitionController@saveReq');
    Route::get('/sale/requisition/goodsadd', 'Order\RequisitionController@showGoodsAdd');
    Route::get('/sale/requisition/edit', 'Order\RequisitionController@showEditForm');
    Route::post('/sale/requisition/savegoods', 'Order\RequisitionController@saveGoods');
    Route::post('/sale/requisition/remove', 'Order\RequisitionController@remove');
    Route::post('/sale/requisition/audit', 'Order\RequisitionController@audit');

    Route::get('/sale/order','Order\OrderController@addOrder');

    Route::get('/sys/templet', 'System\PrintTempletController@index');
    Route::post('/sys/templet/list', 'System\PrintTempletController@listData');
    Route::get('/sys/templet/add', 'System\PrintTempletController@showAddForm');
    Route::get('/sys/templet/edit', 'System\PrintTempletController@showEditForm');
    Route::post('/sys/templet/save', 'System\PrintTempletController@save');
    Route::get('/sys/templet/selectTemplet', 'System\PrintTempletController@selectTemplet');
    Route::get('/sys/templet/print', 'System\PrintTempletController@templetPrint');

    Route::get('/sys/customer/', 'System\CustomerController@index');
    Route::post('/sys/customer/list', 'System\CustomerController@listData');
    Route::get('/sys/customer/add', 'System\CustomerController@showAddPage');
    Route::get('/sys/customer/edit', 'System\CustomerController@showEditPage');
    Route::post('/sys/customer/save', 'System\CustomerController@save');
    Route::get('/sys/customer/addcustomer', 'System\CustomerController@newCustomer');
    Route::get('/sys/customer/linkmanlist', 'System\CustomerController@linkManList');
    Route::get('/sys/customer/customersales', 'System\CustomerController@customerSales');

});


Route::get('/testService/{path}', function ($path) {
    $params = request()->all();
    dd(callApiServer($path, $params));
});